<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<aside class="main-sidebar" th:fragment="aside">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left image">
                <span class="glyphicon glyphicon-th-large" style="font-size: 30px"></span>
            </div>
            <div class="pull-left info">
                <p  th:text="${#authentication.name}">管理员</p>
                <a href="#"><i class="fa fa-circle text-success"></i> 在线</a>
            </div>
        </div>



        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu">
            <li class="header">菜单</li>

            <li id="admin-index"><a href="/backstage/index"><i class="glyphicon glyphicon-home"></i> <span>首页</span></a></li>

            <!-- 菜单 -->



            <li class="treeview" id="system">
                <a href="#">
                    <i class="fa fa-folder"></i> <span>信息管理</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">

                    <li id="admin" >
                        <a href="/backstage/users/all">
                            <i class="fa fa-circle-o"></i> 员工信息管理
                        </a>
                    </li>

                    <li id="role" >
                        <a href="/backstage/users/myAll">
                            <i class="fa fa-circle-o"></i> 个人信息管理
                        </a>
                    </li>

                </ul>
            </li>



            <li class="treeview" id="business">
                <a href="#">
                    <i class="fa fa-laptop"></i> <span>工资管理</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">

                    <li id="category">
                        <a href="/backstage/salary/all" sec:authorize="hasAnyAuthority('/boss')">
                            <i class="fa fa-circle-o"></i> 员工工资管理
                        </a>
                    </li>

                    <li id="product">
                        <a href="/backstage/salary/myAll">
                            <i class="fa fa-circle-o"></i> 个人工资管理
                        </a>
                    </li>

                </ul>
            </li>

            <li class="treeview" id="messages">
                <a href="#">
                    <i class="fa fa-edit"></i> <span>留言</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">

                    <li id="message">
                        <a href="/backstage/message/all">
                            <i class="fa fa-circle-o"></i> 留言讨论
                        </a>
                    </li>
                </ul>
            </li>

        </ul>
    </section>
    <!-- /.sidebar -->
    <script>
        $(function () {
            //点击外层菜单时记录他的id
            $(".treeview").click(function (){
                sessionStorage.menu=$(this).attr("id");
            })
            //点击内层菜单时记录他的id
            $(".treeview li").click(function (){
                sessionStorage.menu2=$(this).attr("id");
            })

            //对已点击的外层菜单添加class属性
            $("#"+sessionStorage.menu).addClass("active")
            //对已点击的内层菜单添加css样式
            $("#"+sessionStorage.menu2+" a").css("color","white")
        })
    </script>
</aside>
</html>